﻿using YunShop_WebAPI.BLL;
using YunShop_WebAPI.Model;
using System.Collections;
using System.Web;
using System.Web.Http;
using System;
using System.IO;
using System.Collections.Generic;
using Newtonsoft.Json.Linq;
using System.Web.Hosting;
using System.Configuration;
using System.Globalization;
using System.Web.Mvc;
using System.Web.Services.Description;

namespace YunShop_WebAPI.API.Controllers
{
    /// <summary>
    /// 商户管理小程序(电子会员卡)
    /// </summary>
    public class MemberShopController : ApiController
    {
        /// <summary>
        /// 
        /// </summary>
        public Result_Member GetMemberData()
        {
            var msg = "";
            var status = 1;
            var appModel = new SystemAppModel();
            appModel.FCorpID = 44;
            appModel.FUserID = 1058842;
            appModel.FStockID = 84;
            appModel.FOwnerID = 4195;
            appModel.FParentID = 0;
            appModel.FDtSplit = "39.98.170.8";
            appModel.FDbSplit = "";
            string sAppID = SystemInfo.SetSystemAppID(appModel);//QEf6vsegP7FLh/2WZRbSwmDnGc3JYtsR09cTCradccdE0b15A+N1SM5CWJ/RIRuj

            string sSystemAppID = CommonFun.ConvertToString(HttpContext.Current.Request.Headers["mSystemAppID"]);
            var data = MemberShopService.GetMemberData(sSystemAppID);
            if (data == null || data.Count == 0)
            {
                status = 0;
                msg = "会员信息不存在，请创建";
            }
            return new Result_Member(status, msg, data);
        }        

    }
}